﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace Bootstrap
{
    public class Routes : IRouteProvider
    {
        public IEnumerable<RouteDescriptor> GetRoutes() {
            return new[] {
                new RouteDescriptor() {
                    Route = new Route(
                        "admin/bootstrap/import",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Admin"},
                            {"action", "Import"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                },
                new RouteDescriptor() {
                    Route = new Route(
                        "admin/bootstrap/export",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Admin"},
                            {"action", "Export"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                },
                new RouteDescriptor() {
                    Route = new Route(
                        "admin/bootstrap/settings",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Admin"},
                            {"action", "Settings"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                },
                new RouteDescriptor() {
                    Route = new Route(
                        "admin/bootstrap/features",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Admin"},
                            {"action", "Features"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                },
                new RouteDescriptor() {
                    Route = new Route(
                        "admin/bootstrap/variables",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Admin"},
                            {"action", "Variables"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                },
                new RouteDescriptor() {
                    Route = new Route(
                        "Themes/Bootstrap/Styles/bootstrap.debug.css",
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"},
                            {"controller", "Bootstrap"},
                            {"action", "Build"},
                            {"priority", 1000}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary() {
                            {"area", "Bootstrap"}
                        },
                        new MvcRouteHandler()
                        )
                }
            };
        }

        public void GetRoutes(ICollection<RouteDescriptor> routes) {
            GetRoutes().ToList().ForEach(routes.Add);
        }
    }
}
